package designpatterns.interpreter;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/16/2022 7:32 PM
 */
public class TerminalExpression implements Expression {

    private final String data;

    public TerminalExpression(String data) {
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        return context.contains(data);
    }
}
